Skip to content

drivers/mtd: Make compile time check for sane mtd isbad/markbad configuration#19145

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
tiiuae:fix_ftl_bbm_configuration
Jun 16, 2026
Merged

drivers/mtd: Make compile time check for sane mtd isbad/markbad configuration#19145
xiaoxiang781216 merged 1 commit into
apache:masterfrom
tiiuae:fix_ftl_bbm_configuration

Conversation

@jlaitine

Copy link
Copy Markdown
Contributor

Summary

This removes the DEBUGASSERT in ftl_initialize_by_path. Instead, check compile time that FTL is enabled in case some of the drivers implement the isbad and markbad functions.

Also select the FTL_BBM for those drivers as they require it.

Impact

This checks the validity of bad-block management configuration at build time; the compilation fails
if the mtd driver implements bad block management, but the configuration doesn't enable the FTL_BBM

Testing

Tested by compiling this PR in CI

@github-actions github-actions Bot added Area: Drivers Drivers issues Size: S The size of the change in this PR is small labels Jun 15, 2026
Comment thread drivers/mtd/Kconfig Outdated
@jlaitine jlaitine force-pushed the fix_ftl_bbm_configuration branch from a212414 to d934816 Compare June 15, 2026 17:26
@jlaitine jlaitine marked this pull request as ready for review June 15, 2026 19:04
…guration

This removes the DEBUGASSERT in ftl_initialize_by_path. Instead, check
compile time that FTL is enabled in case some of the drivers implement
the isbad and markbad functions.

Also select the FTL_BBM for those drivers as they require it.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
@jlaitine jlaitine force-pushed the fix_ftl_bbm_configuration branch from d934816 to 71ef4e2 Compare June 15, 2026 20:44
@jlaitine jlaitine requested a review from simbit18 as a code owner June 15, 2026 20:44
@github-actions github-actions Bot added the Arch: arm Issues related to ARM (32-bit) architecture label Jun 15, 2026
@xiaoxiang781216 xiaoxiang781216 merged commit cbfaa7c into apache:master Jun 16, 2026
41 checks passed
@michallenc

Copy link
Copy Markdown
Contributor

@jlaitine thanks for the fix! Tested now and works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Drivers Drivers issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants